<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- lazy 懒加载 只有失去焦点或者按回车键的时候才触发双向绑定-->
      <input type="text" v-model.lazy.trim="msg">
      <h2>{{msg}}</h2>
      <hr>

      <!-- 类型转换:number -->
      <input type="number" name=""  id="" v-model.number="number">
      <h2>{{number}} =={{typeof number}}</h2>
      <hr>
      <!-- trim 过滤空白字符 -->
      <input type="text" v-model.trim="testName">
      <h2>xxx{{testName}}xxx</h2>
    </div>

    <script src="../js/vue.js"></script>

    <script>
      const app = Vue.createApp({
        data() {
          return {
            msg: "默认",
            number:0,
            testName:'',
          }
        }
      }).mount("#app");
    </script>
  </body>
</html>